package com.zyong.design.pattern.interpret.case2;

import java.util.HashMap;
import java.util.Map;

/**
 * 环境类
 * @program: zyong-design-pattern
 * @ClassName: Context
 * @author: zyong
 * @create: 2024-06-01 21:38
 */
public class Context {
    private Map<Variable, Boolean> map = new HashMap<Variable, Boolean>();

    public void assign(Variable var, boolean value) {
        map.put(var, new Boolean(value));
    }

    public boolean lookup(Variable var) {
        return map.get(var).booleanValue();
    }
}
